package com.BraveY.Demo10;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Demo05 {
    public static void main(String[] args) {
        Map<String,String> maps = new HashMap<>();
        maps.put("001","张三");
        maps.put("002","李四");
        maps.put("003","王五");
        maps.put("004","赵六");
//        System.out.println(maps);
//        maps.remove("001");
//        System.out.println(maps);
        Set<String> maplist = maps.keySet();
        for (String key:maplist){
            String value = maps.get(key);
            System.out.println(key + value);

        }
        System.out.println("第二中方式");
       Set<Map.Entry<String,String>> list = maps.entrySet();
        for (Map.Entry<String,String> obj : list){
            String key  = obj.getKey();
            String value = obj.getValue();
            System.out.println(key + value);

        }
    }
}
